//    Copyright (C) Kherty.  All rights reserved.
using System.ComponentModel;
using System.Globalization;
using OpenLS.Spreadsheet.UI.Internals;
using OpenLS.Spreadsheet.UI.Internals.Resources;

namespace OpenLS.Spreadsheet.UI
{
    class TableStyleGrouping : GroupDescription
    {
        public override object GroupNameFromItem(object item, int level, CultureInfo culture)
        {
            var style = (TableStyle) item;
            if (style.Name.StartsWith("TableStyleMedium"))
                return UIStringTable.Medium;
            if (style.Name.StartsWith("TableStyleLight"))
                return UIStringTable.Light;
            if (style.Name.StartsWith("TableStyleDark"))
                return UIStringTable.Dark;
            return UIStringTable.Other;
        }
    }
}
